package rsj.api.user;

import com.rlyy.aibase.utils.base.Box;
import common.checkgroup.UpdateGroup;
import common.util.BoxUtil;
import common.util.validator.ParameterConversionCheck;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rsj.api.user.entity.UserAccount;
import rsj.service.user.IUserService;

import javax.validation.groups.Default;

/**
 * 用户
 *
 * @author yuanqinglong
 * @since 2021/7/21 10:41
 */
@RestController
public class UserController {

    @Autowired
    private IUserService userServiceImpl;


    /**
     * 更新密码
     *
     * @param param 参数
     * @return {@link Box}
     */
    @RequestMapping(value = "rsj_user_password_update")
    public Box updatePassword(Box param) {
        UserAccount userAccount = ParameterConversionCheck.parameterConversionCheckFastFail(param, UserAccount.class, Default.class, UpdateGroup.class);
        userServiceImpl.updateUserPassword(userAccount);
        return BoxUtil.successBox(param);
    }

}
